﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<List<object>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">

    <h2>sendCommand</h2>
    <table width="60%" border="0" cellspacing="2" cellpadding="2" class="datatable">
        
        <% foreach (var item in Model)
           {
                           
        %>
        <tr>
            <td id="dato">
                <%= Html.Encode(item) %>
            </td>
        </tr>
        <% } %>
    </table>

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
<script type="text/javascript">

    function initialize() {

        var id;
        var unit;
        id = $("#dato").text();

        unit = id.valueOf();

        alert(unit);


        window.location="http://190.154.203.99:81/command?user=prueba&pass=12345&unit="+unit+"&unittype=5&addr=200.25.197.67&name=status"

    
    }

    $(window).load(function () {
        initialize();
    });

    


 </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MenuContentPlaceHolder" runat="server">
</asp:Content>
